package cn.edu.jxau.test;

import java.util.Arrays;
import java.util.Objects;

public class Main {

	public static void main(String[] args) {

		Node root = new Node();
		root.left = new Node();
		root.left.left = new Node();
		root.left.right = new Node();
		root.left.right.left = new Node();
		root.right = new Node();
		root.right = new Node();
		System.out.println(depth(root));

	}

	public static int depth(Node node) {

		if (node == null) {
			return 0;
		}
		int lDepth = depth(node.left) + 1;
		int rDepth = depth(node.right) + 1;
		return lDepth > rDepth ? lDepth : rDepth;
	}
}

class Node {
	public Node left;
	public Node right;

	public Node() {

	}
}
